<%--
  Created by IntelliJ IDEA.
  User: 86131
  Date: 2021/8/29
  Time: 15:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>12588_一按我帮你</title>

    <!-- Bootstrap -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
    <script src="js/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="font/iconfont.css">
    <script src="js/message.js"></script>
    <style>
        .paddtop{
            padding-top: 5px;
        }
        .search-input{
            float:left;
            border:2px dodgerblue solid;
            width: 400px;
            height: 35px;
            padding-left: 5px;
            margin-top: 5px;
            margin-left: 60px;
        }
        .search-btn{
            float:left;
            border: 1px dodgerblue solid;
            width: 90px;
            height: 35px;
            background-color: dodgerblue;
            text-align: center;
            line-height: 35px;
            color: white;
            margin-top: 5px;
        }
        .login{
            margin-top: 12px;

        }
        .gn{
            border-bottom: 2px dodgerblue solid;
        }
        .query{
            border: 1px darkgray solid ;
        }
        .padleft{
            padding-left: 100px;
        }
        .cha{
            padding-top: 5px;
        }
        .foot{
            background-color:dodgerblue ;
            text-align: center;
            height: 35px;
            line-height: 35px;
            color: white;
        }

    </style>
</head>
<body>
<!--页眉部分-->
<div class="container">
    <h3>车票</h3>
    <table class="table table-hover">
        <%--            表格头--%>
        <tr class="success">
            <th>编号</th>
            <th>车次</th>
            <th>日期</th>
            <th>发站</th>
            <th>到站</th>
            <th>车厢号</th>
            <th>座位</th>
            <th>状态</th>
            <th>操作</th>
        </tr>

        <%--    获取 到的真实数据--%>
        <c:forEach items="${tickets}" var="ticket" varStatus="s">
            <tr>
                <td>${s.count}</td>
                <td>${ticket.trainNumber}</td>
                <td>${ticket.date}</td>
                <td>${ticket.startStation}<br>
                    <font color="dodgerblue" style="font-weight: bold">${ticket.startTime}</font>
                </td>
                <td>${ticket.endStation}<br>
                        <font color="dodgerblue">${ticket.endTime}</font>
                </td>
                <td>${ticket.vehicleNumber}</td>
                <td>${ticket.seatNumber}</td>
                <td>${ticket.status}</td>
                <td><a class="btn btn-default btn-sm" onclick="confirm({
                title: '退票',
                content: '您确认要退票吗？',
                doneText: '嗯',
                canalText: '点错了'
            }).then(() => {
                console.log('已确认')
                window.open('${pageContext.request.contextPath}/ReturnTicketServlet?id=${ticket.id}&&date=${ticket.date}&&status=${ticket.status}&&trainNumber=${ticket.trainNumber}&&index=1','_self');
            }).catch(() => {
                console.log('已取消')
            })" >退票</a>
                    <a class="btn btn-default btn-sm" onclick="confirm({
                            title: '改签',
                            content: '确定要改签吗',
                            doneText: '是的',
                            cancalText: '不是的'
                            }).then(() => {
                            console.log('已确认')
                            window.open('${pageContext.request.contextPath}/ReturnTicketServlet?id=${ticket.id}&&date=${ticket.date}&&status=${ticket.status}&&trainNumber=${ticket.trainNumber}&&index=2','_self');
                            }).catch(() => {
                            console.log('已取消')
                            })" >改签</a></td>
            </tr>
        </c:forEach>
    </table>
</div>
</body>
</html>
